uninhibitedDescriptionWithUser: _("%s will be logged out automatically in %d seconds."),
uninhibitedDescription: _("You will be logged out automatically in %d seconds."),
endDescription: _("Logging out of the system."),
- confirmButtonText: _("Log Out"),
+ confirmButtons: [{ signal: 'ConfirmedLogout',
+ label: _("Log Out") }],
iconStyleClass: 'end-session-dialog-logout-icon'
};
const shutdownDialogContent = {
- subject: _("Shut Down"),
- inhibitedDescription: _("Click Shut Down to quit these applications and shut down the system."),
- uninhibitedDescription: _("The system will shut down automatically in %d seconds."),
- endDescription: _("Shutting down the system."),
- confirmButtonText: _("Shut Down"),
+ subject: _("Power Off"),
+ inhibitedDescription: _("Click Power Off to quit these applications and power off the system."),
+ uninhibitedDescription: _("The system will power off automatically in %d seconds."),
+ endDescription: _("Powering off the system."),
+ confirmButtons: [{ signal: 'ConfirmedReboot',
+ label: _("Restart") },
+ { signal: 'ConfirmedShutdown',
+ label: _("Power Off") }],
iconName: 'system-shutdown',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
inhibitedDescription: _("Click Restart to quit these applications and restart the system."),
uninhibitedDescription: _("The system will restart automatically in %d seconds."),
endDescription: _("Restarting the system."),
- confirmButtonText: _("Restart"),
+ confirmButtons: [{ signal: 'ConfirmedReboot',
+ label: _("Restart") }],
iconName: 'system-shutdown',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
return;
let dialogContent = DialogContent[this._type];
- let confirmButtonText = _("Confirm");
-
- if (dialogContent.confirmButtonText)
- confirmButtonText = dialogContent.confirmButtonText;
-
- this.setButtons([{ label: _("Cancel"),
- action: Lang.bind(this, this.cancel),
- key: Clutter.Escape
- },
- { label: confirmButtonText,
- action: Lang.bind(this, this._confirm)
- }]);
+ let buttons = [{ action: Lang.bind(this, this.cancel),
+ label: _("Cancel"),
+ key: Clutter.Escape }];
+
+ for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
+ let signal = dialogContent.confirmButtons[i].signal;
+ let label = dialogContent.confirmButtons[i].label;
+ buttons.push({ action: Lang.bind(this, function() {
+ this._confirm(signal);
+ }),
+ label: label });
+ }
+
+ this.setButtons(buttons);
},
close: function() {
this.close(global.get_current_time());
},
- _confirm: function() {
+ _confirm: function(signal) {
this._fadeOutDialog();
this._stopTimer();
DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
'org.gnome.SessionManager.EndSessionDialog',
- 'Confirmed', '', []);
+ signal, '', []);
},
_onOpened: function() {
time: this._secondsLeft,
transition: 'linear',
onUpdate: Lang.bind(this, this._updateContent),
- onComplete: Lang.bind(this, this._confirm),
+ onComplete: Lang.bind(this, function() {
+ let dialogContent = DialogContent[this._type];
+ let button = dialogContent.confirmButtons[dialogContent.confirmButtons.length - 1];
+ this._confirm(button.signal);
+ }),
});
},